package com.fastfly.domain;

import javax.persistence.Entity;
import javax.persistence.ManyToOne;
import javax.persistence.Transient;

@Entity
public class Seat extends BaseEntity {

	public static final String AVAILABLE_STATUS = "A";
	public static final String RESERVED_STATUS = "R";

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@ManyToOne
	protected Flight flight;

	protected int number;
	protected String status = AVAILABLE_STATUS;
	
	

	public Seat() {
	}
	
	public Seat(Flight flight, int number) {
		super();
		this.flight = flight;
		this.number = number;
	}



	public Flight getFlight() {
		return flight;
	}

	public void setFlight(Flight flight) {
		this.flight = flight;
	}

	public int getNumber() {
		return number;
	}

	public void setNumber(int number) {
		this.number = number;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}
	
	@Transient
	public boolean isAvailable() {
		return AVAILABLE_STATUS.equalsIgnoreCase(status);
	}

}
